﻿using System.Collections.Generic;
using UnityEngine;
public class PsActionNodeOp : MonoBehaviour
{

    [SerializeField]
    [Header("描述")]
    public string m_strDesc = "根据时间操作";

    [SerializeField]
    [Header("触发的时间")]
    float m_fAcitveTime = 0;

    [SerializeField]
    List<GameObject> m_ShowList = new List<GameObject>();
    [SerializeField]
    List<GameObject> m_HideList = new List<GameObject>();

    SmartTimer m_Timer = new SmartTimer();

    private void OnEnable()
    {
        m_Timer.DoReset(m_fAcitveTime);

    }

    private void OnDisable()
    {
    }


    private void Update()
    {
        if (m_Timer.DoUpdate())
        {
            foreach (var item in m_ShowList)
            {
                item?.SetActive(true);
            }
            foreach (var item in m_HideList)
            {
                item?.SetActive(false);
            }
        }
    }
}
